package cn.bearspark.user.provider.rpc;

import cn.bearspark.user.provider.service.UserHappeningService;
import cn.bearspark.user.rpc.UserHappeningRpc;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Component;

import java.util.Date;
import java.util.Map;

/**
 * @author f
 */
@Component
@DubboService
public class UserHappeningRpcImpl implements UserHappeningRpc {

    private final UserHappeningService userHappeningService;

    public UserHappeningRpcImpl(UserHappeningService userHappeningService) {
        this.userHappeningService = userHappeningService;
    }

    @Override
    public void afterPublishHappening(long userId) {
        userHappeningService.afterPublishHappening(userId);
    }

    @Override
    public void afterDeleteHappening(long userId, Date lastPubTime) {
        userHappeningService.afterDeleteHappening(userId, lastPubTime);
    }

    @Override
    public void afterPublishScheduledHappening(Map<Long, Long> userHappeningCntMap) {
        userHappeningService.afterPublishScheduledHappening(userHappeningCntMap);
    }
}
